import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import { fileURLToPath, URL } from 'node:url';
// import path from 'node:path';

// https://vite.dev/config/
export default defineConfig(() => {
  return {
    plugins: [vue()],
    resolve: {
      alias: {
        '@': fileURLToPath(new URL('./src', import.meta.url)),
      },
    },
    // resolve: {
    //   alias: {
    //     '~/': `${path.resolve(__dirname, 'src')}/`,
    //   },
    // },
    // vitesse项目配置 https://github.com/antfu-collective/vitesse/blob/main/vite.config.ts
    // 1.引用文件则改成~前缀  import directive from '~/views/directive/index.vue';
    // 2.tsconfig.json配置 path也要修改
  };
});
